package cn.bytecollege.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Pattern;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CommunityWorkerVO {
    private Integer userId;
    @Pattern(regexp = "\\w{6,12}",message = "用户名必须是长度为6-12位的数字，字母，下划线")
    private String username;
    private String password;
    private String address;
    private String telephone;

    private String realName;


    /**
     * 添加
     * @param username
     * @param password
     * @param address
     * @param telephone
     * @param realName
     */
    public CommunityWorkerVO(String username, String password, String address, String telephone, String realName) {
        this.username = username;
        this.password = password;
        this.address = address;
        this.telephone = telephone;
        this.realName = realName;
    }

    /**
     * 查询
     * @param userId
     * @param username
     * @param address
     * @param telephone
     */
    public CommunityWorkerVO(Integer userId, String username, String address, String telephone) {
        this.userId = userId;
        this.username = username;
        this.address = address;
        this.telephone = telephone;
    }
}
